package com.example.basicstate.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.basicstate.ui.components.WaterCounter
import com.example.basicstate.ui.components.WellnessTasksList

@Composable
fun WellnessScreen(modifier: Modifier = Modifier, wellnessViewModel: WellnessViewModel = viewModel()) {
    Column(modifier = modifier) {
        WaterCounter()
        WellnessTasksList(
            list = wellnessViewModel.tasks,
            onCheckedChange = { task, checked ->
              wellnessViewModel.changeTaskChecked(task, checked)
            },
            onCloseTask = { task -> wellnessViewModel.remove(task) }
        )
    }
}
